
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>网络生成配置说明 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="chap3.html" />
    
    
    <link rel="prev" href="chap1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    编译部署
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="chap1.html">
            
                <a href="chap1.html">
            
                    
                    编译与测试网络部署
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="chap2.html">
            
                <a href="chap2.html">
            
                    
                    网络生成配置说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="chap3.html">
            
                <a href="chap3.html">
            
                    
                    启动网络脚本配置剖析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    通道实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="chap4.html">
            
                <a href="chap4.html">
            
                    
                    创建加入通道
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="chap5.html">
            
                <a href="chap5.html">
            
                    
                    更新通道配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="chap6.html">
            
                <a href="chap6.html">
            
                    
                    动态添加组织
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    合约实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="chap7.html">
            
                <a href="chap7.html">
            
                    
                    安装发布智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="chap8.html">
            
                <a href="chap8.html">
            
                    
                    升级智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="chap9.html">
            
                <a href="chap9.html">
            
                    
                    智能合约设置背书策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="chap10.html">
            
                <a href="chap10.html">
            
                    
                    调试go智能合约
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="chap11.html">
            
                <a href="chap11.html">
            
                    
                    外部构建启动合约
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    SDK实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="chap12.html">
            
                <a href="chap12.html">
            
                    
                    基于Java SDK实现合约交易
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >网络生成配置说明</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x4E3A;&#x4E86;&#x52A0;&#x6DF1;&#x5BF9;2.0&#x7684;&#x8BA4;&#x8BC6;&#xFF0C;&#x4ECE;first-network&#x7684;&#x90E8;&#x7F72;&#x914D;&#x7F6E;&#x5F00;&#x59CB;&#x8FDB;&#x884C;&#x5B66;&#x4E60;&#x3002;
&#x4E0A;&#x7BC7;&#x6709;&#x63D0;&#x5230;&#x5728;&#x8FD0;&#x884C;Fabric&#x7F51;&#x7EDC;&#x524D;&#xFF0C;&#x5148;&#x6267;&#x884C;&#x4E86;<code>./byfn.sh generate</code> &#x5B9E;&#x73B0;&#x521B;&#x59CB;&#x533A;&#x5757;&#x3001;&#x901A;&#x9053;&#x4EE5;&#x53CA;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x7684;&#x751F;&#x6210;&#xFF0C;&#x63A5;&#x4E0B;&#x6765;&#x8BA9;&#x6211;&#x4EEC;&#x7B80;&#x5355;&#x7684;&#x5256;&#x6790;&#x4E00;&#x4E0B; <code>./byfn.sh generate</code> &#x7684;&#x5B9E;&#x73B0;&#x3002;</p>
<h2 id="1byfnsh-generate">1.byfn.sh generate</h2>
<p>&#x9996;&#x5148;&#x4ECE;byfn.sh&#x7684;&#x811A;&#x672C;&#x53EF;&#x4EE5;&#x89C2;&#x5BDF;&#x5230;&#xFF0C;&#x811A;&#x672C;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x4E3A;&#x6267;&#x884C;&#x6A21;&#x5F0F;&#xFF0C;&#x5176;&#x4E2D;&#x6A21;&#x5F0F;&#x5305;&#x542B;up&#x3001;down&#x3001;generate&#x3001;restart&#x4EE5;&#x53CA;upgrade&#xFF0C;&#x4EE3;&#x8868;&#x542F;&#x52A8;&#x3001;&#x6E05;&#x9664;&#x3001;&#x751F;&#x6210;&#x4EE5;&#x53CA;&#x5347;&#x7EA7;&#x7F51;&#x7EDC;&#x3002;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x5173;&#x6CE8;&#x7684;&#x662F;generate,&#x5728;generate&#x4E3B;&#x8981;&#x6267;&#x884C;&#x4E24;&#x4E2A;function&#xFF0C;&#x5206;&#x522B;&#x662F;<br>generateCerts :&#x751F;&#x6210;&#x8BC1;&#x4E66;&#x3001;<br>generateChannelArtifacts &#xFF1A;&#x751F;&#x6210;&#x521B;&#x59CB;&#x533A;&#x5757;&#x4E0E;&#x901A;&#x9053;&#x6587;&#x4EF6;&#x3002;</p>
<p><img src="https://img-blog.csdnimg.cn/20200212180658344.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<h2 id="2-generatecerts">2. generateCerts</h2>
<p>generateCerts &#xFF1A;&#x751F;&#x6210;&#x8BC1;&#x4E66;
&#x8BE6;&#x7EC6;&#x6765;&#x770B;&#x811A;&#x672C;</p>
<p><img src="https://img-blog.csdnimg.cn/20200212181305122.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;">
&#x4E3B;&#x8981;&#x6267;&#x884C;&#x4E86;&#x4E24;&#x4E2A;&#x6838;&#x5FC3;&#x811A;&#x672C;&#x5206;&#x522B;&#x662F;&#xFF1A;
1.<code>cryptogen generate --config=./crypto-config.yaml</code>  </p>
<pre><code>&#x5B9E;&#x73B0;&#x6839;&#x636E;crypto-config.yaml &#x751F;&#x6210;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x3002;
</code></pre><p>2.<code>./ccp-generate.sh</code></p>
<pre><code>&#x751F;&#x6210;&#x8C03;&#x7528;nodejs SDK&#x7684;&#x76F8;&#x5173;&#x533A;&#x5757;&#x94FE;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x3002;
</code></pre><h3 id="21-&#x751F;&#x6210;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;">2.1 &#x751F;&#x6210;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;</h3>
<p>&#x6253;&#x5F00;first-network&#x76EE;&#x5F55;&#x4E0B;&#x9762;&#x7684;crypto-config.yaml&#x6587;&#x4EF6;&#x3002;
crypto-config.yaml&#x4E3B;&#x8981;&#x5305;&#x542B;&#x7684;fabric&#x6392;&#x5E8F;&#x8282;&#x70B9;&#x8BC1;&#x4E66;&#x914D;&#x7F6E;&#x4EE5;&#x53CA;fabric&#x7EC4;&#x7EC7;&#x8BC1;&#x4E66;&#x914D;&#x7F6E;&#x3002;</p>
<ul>
<li><strong>&#x6392;&#x5E8F;&#x8282;&#x70B9;&#x8BC1;&#x4E66;&#x914D;&#x7F6E;</strong>
&#x914D;&#x7F6E;&#x4E86;5&#x4E2A;&#x6392;&#x5E8F;&#x8282;&#x70B9;&#xFF0C;&#x57DF;&#x540D;&#x4E3A;&#xFF1A;Hostname + Domain eg:orderer.example.com</li>
</ul>
<pre><code class="lang-powershellOrdererOrgs:">  - Name: Orderer
    Domain: example.com
    Specs:
      - Hostname: orderer
      - Hostname: orderer2
      - Hostname: orderer3
      - Hostname: orderer4
      - Hostname: orderer5
</code></pre>
<p>  <strong>&#x652F;&#x6301;&#x5176;&#x4ED6;&#x914D;&#x7F6E;&#x6A21;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</strong></p>
<p>&#xFF08;1&#xFF09;&#x91CD;&#x5199;&#x5168;&#x9650;&#x5B9A;&#x57DF;&#x540D;</p>
<p> CommonName</p>
<pre><code> &#x9ED8;&#x8BA4;&#x503C;&#x4E3A;Hostname.Domain
</code></pre><pre><code>OrdererOrgs:
  - Name: Orderer
    Domain: example.com
    Specs:
      - Hostname: orderer
        CommonName: myorderer.example.com
</code></pre><p>&#xFF08;2&#xFF09;&#x66FF;&#x6362;Specs&#x4E3A;Template&#x914D;&#x7F6E;&#x5F0F;</p>
<h1 id="template-&#x4F7F;&#x7528;&#x6A21;&#x677F;&#x5B9A;&#x4E49;&#x8282;&#x70B9;">Template &#x4F7F;&#x7528;&#x6A21;&#x677F;&#x5B9A;&#x4E49;&#x8282;&#x70B9;</h1>
<h1 id="count-&#x8282;&#x70B9;&#x603B;&#x6570;">Count &#x8282;&#x70B9;&#x603B;&#x6570;</h1>
<h1 id="start-&#x8282;&#x70B9;&#x4E0B;&#x6807;&#x8D77;&#x59CB;&#x503C;">Start &#x8282;&#x70B9;&#x4E0B;&#x6807;&#x8D77;&#x59CB;&#x503C;</h1>
<h1 id="hostname-&#x5168;&#x9650;&#x5B9A;&#x57DF;&#x540D;-&#x547D;&#x540D;&#x683C;&#x5F0F;">Hostname &#x5168;&#x9650;&#x5B9A;&#x57DF;&#x540D; &#x547D;&#x540D;&#x683C;&#x5F0F;</h1>
<h1 id="prefix-&#x9ED8;&#x8BA4;-peer">Prefix &#x9ED8;&#x8BA4; peer</h1>
<h1 id="index-&#x53D6;start&#x503C;-&#x65E0;&#x914D;&#x7F6E;&#x4ECE;1&#x5F00;&#x59CB;&#x81EA;&#x589E;">Index &#x53D6;Start&#x503C; &#x65E0;&#x914D;&#x7F6E;&#x4ECE;1&#x5F00;&#x59CB;&#x81EA;&#x589E;</h1>
<pre><code>OrdererOrgs:
  - Name: Orderer
    Domain: example.com
    Template:
      Count: 5
      Start: 1
      Prefix&#xFF1A;order
</code></pre><ul>
<li><strong>&#x7EC4;&#x7EC7;&#x8BC1;&#x4E66;&#x914D;&#x7F6E;</strong>
&#x914D;&#x7F6E;&#x4E86;&#x4E24;&#x4E2A;&#x7EC4;&#x7EC7;&#xFF0C;&#x6BCF;&#x4E2A;&#x7EC4;&#x7EC7;2&#x5957;&#x516C;&#x79C1;&#x94A5;&#x548C;&#x8BC1;&#x4E66;&#xFF0C;&#x5305;&#x542B;&#x666E;&#x901A;User&#xFF08;Admin&#x4E0D;&#x5305;&#x542B;&#x5728;&#x8BA1;&#x6570;&#x4E2D;&#xFF09;&#x6570;&#x91CF;&#x4E3A;1</li>
</ul>
<pre><code>PeerOrgs:
  - Name: Org1
    Domain: org1.example.com
    EnableNodeOUs: true
    Template:
      Count: 2
     Users:
      Count: 1

  - Name: Org2
    Domain: org2.example.com
    EnableNodeOUs: true
    Template:
      Count: 2
    Users:
      Count: 1
</code></pre><h1 id="domain-&#x57DF;&#x540D;">Domain &#x57DF;&#x540D;</h1>
<h1 id="template-&#x53C2;&#x8003;ordererorgs-&#x53EF;&#x66FF;&#x6362;&#x4E3A;specs&#x914D;&#x7F6E;&#x5F0F;">Template &#x53C2;&#x8003;OrdererOrgs &#x53EF;&#x66FF;&#x6362;&#x4E3A;Specs&#x914D;&#x7F6E;&#x5F0F;</h1>
<h1 id="users---count-&#x6DFB;&#x52A0;&#x5230;&#x7BA1;&#x7406;&#x5458;&#x7684;&#x7528;&#x6237;&#x5E10;&#x6237;&#x6570;">Users -&gt; Count &#x6DFB;&#x52A0;&#x5230;&#x7BA1;&#x7406;&#x5458;&#x7684;&#x7528;&#x6237;&#x5E10;&#x6237;&#x6570;</h1>
<h1 id="enablenodeous-&#x5141;&#x8BB8;&#x8282;&#x70B9;-ous---out-of-service&#xFF0C;&#x7528;&#x4E8E;&#x533A;&#x5206;clients-admins-peers&#x3002;&#x5047;&#x5982;true&#x4F1A;&#x5728;msp&#x76EE;&#x5F55;&#x751F;&#x6210;configyaml&#x5982;&#x4E0B;&#xFF1A;">EnableNodeOUs &#x5141;&#x8BB8;&#x8282;&#x70B9; OUS -&gt; out of service&#xFF0C;&#x7528;&#x4E8E;&#x533A;&#x5206;clients, admins, peers&#x3002;&#x5047;&#x5982;true&#x4F1A;&#x5728;msp&#x76EE;&#x5F55;&#x751F;&#x6210;config.yaml&#x5982;&#x4E0B;&#xFF1A;</h1>
<p><img src="https://img-blog.csdnimg.cn/20200212183512768.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p>&#x6B64;&#x5904;&#x8BC1;&#x4E66;&#x7ED3;&#x6784;&#x4E0D;&#x505A;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#xFF0C;&#x8BE6;&#x60C5;&#x67E5;&#x770B;<a href="https://hyperledger-fabric.readthedocs.io/en/release-2.0/msp.html#" target="_blank">Fabric2.0&#x5B98;&#x65B9;&#x6587;&#x6863;</a></p>
<h3 id="22-ccp-generatesh">2.2 ./ccp-generate.sh</h3>
<p>  &#x751F;&#x6210;&#x8C03;&#x7528;nodejs SDK&#x7684;&#x76F8;&#x5173;&#x533A;&#x5757;&#x94FE;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x3002;&#x6B64;&#x5904;&#x4E0D;&#x4F5C;&#x8BE6;&#x7EC6;&#x914D;&#x7F6E;&#x8BF4;&#x660E;&#x3002;</p>
<h2 id="3-generatechannelartifacts">3. generateChannelArtifacts</h2>
<pre><code>generateChannelArtifacts &#xFF1A;&#x751F;&#x6210;&#x521B;&#x59CB;&#x533A;&#x5757;&#x4E0E;&#x901A;&#x9053;&#x6587;&#x4EF6;
</code></pre><h3 id="31-&#x751F;&#x6210;&#x521B;&#x59CB;&#x533A;&#x5757;">3.1 &#x751F;&#x6210;&#x521B;&#x59CB;&#x533A;&#x5757;</h3>
<p>&#x811A;&#x672C;&#xFF1A;</p>
<pre><code> configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
</code></pre><p>&#x7531;&#x4E8E;&#x6211;&#x63A5;&#x89E6;Fabric&#x662F;&#x4ECE;2018&#x5E74;&#x5F00;&#x59CB;&#x5C31;&#x662F;1.x&#x65F6;&#x4EE3;&#xFF0C;2.x&#x7684;&#x8BDD;&#x5B8C;&#x5168;&#x662F;&#x6CA1;&#x6709;&#x63A5;&#x89E6;&#xFF0C;&#x770B;&#x5230;&#x4E0A;&#x9762;&#x7684;shell&#xFF0C;&#x660E;&#x663E;&#x5C31;&#x6709;&#x4E86;&#x70B9;2.0&#x7684;&#x5473;&#x9053;&#xFF0C;&#x6309;&#x7167;&#x5E38;&#x89C4;&#x5957;&#x8DEF;&#x5148;&#x770B;2.0&#x5B98;&#x65B9;&#x6587;&#x6863;&#x89E3;&#x91CA;&#xFF1A;</p>
<p><img src="https://img-blog.csdnimg.cn/20200212184447673.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;">
configtxgen &#x547D;&#x4EE4;&#x53C2;&#x6570;&#x7684;&#x4F7F;&#x7528;&#x5728;2.0&#x53D1;&#x751F;&#x4E86;&#x53D8;&#x5316;&#xFF0C;&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x6BD4;&#x8F83;&#x6211;&#x653E;&#x4E00;&#x4E0B;1.4&#x5B98;&#x65B9;&#x6587;&#x6863;&#x7684;&#xFF1A;</p>
<p><img src="https://img-blog.csdnimg.cn/20200212184522666.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;">
&#x5DEE;&#x522B;&#x5728;&#x4E8E; &#x521B;&#x4E16;&#x533A;&#x5757;&#x7684;&#x7F51;&#x7EDC;&#x5171;&#x8BC6;&#x6A21;&#x5F0F;&#x5B9A;&#x4E49;&#x53D8;&#x4E86;&#xFF0C;<strong>&#x5220;&#x9664;&#x4E86;TwoOrgsOrdererGenesis(&#x539F;&#x672C;&#x7684;&#x6392;&#x5E8F;&#x8282;&#x70B9;&#x521B;&#x59CB;&#x533A;&#x5757;&#x914D;&#x7F6E;)&#x3001;SampleDevModeKafka (kafka&#x5171;&#x8BC6;&#x914D;&#x7F6E;)</strong>&#x3002;</p>
<p>&#x5269;&#x4F59;&#x7684;&#x8FD8;&#x662F;&#x89E3;&#x91CA;&#x4E00;&#x4E0B;&#xFF1A;</p>
<p><strong>SampleMultiNodeEtcdRaft&#xFF1A;&#x7528;&#x4E8E;&#x751F;&#x6210;&#x521B;&#x59CB;&#x533A;&#x5757;&#x7684;&#xFF0C;&#x914D;&#x5408;-o&#x4E00;&#x8D77;&#x7528;&#xFF0C;&#x652F;&#x6301;etcdraft&#x6A21;&#x5F0F;&#x7684;&#x5171;&#x8BC6;&#x3002;</strong></p>
<p><strong>TwoOrgsChannel&#xFF1A;&#x7528;&#x4E8E;&#x751F;&#x6210;&#x901A;&#x9053;&#x7684;&#x3002;</strong></p>
<p>&#x5269;&#x4E0B;&#x751F;&#x6210;&#x901A;&#x9053;&#x7684;&#x811A;&#x672C;&#x4E0E;&#x539F;&#x5148;&#x7684;&#x6CA1;&#x6709;&#x592A;&#x5927;&#x5DEE;&#x8DDD;&#x6B64;&#x5904;&#x4E0D;&#x4F5C;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#xFF0C;&#x8BE6;&#x60C5;&#x8BF7;&#x770B;<a href="https://hyperledger-fabric.readthedocs.io/en/release-2.0/msp.html#" target="_blank">&#x5B98;&#x65B9;&#x6587;&#x6863;&#x8BF4;&#x660E;</a>&#xFF0C;</p>
<h3 id="32-&#x901A;&#x9053;&#x6587;&#x4EF6;&#x751F;&#x6210;">3.2 &#x901A;&#x9053;&#x6587;&#x4EF6;&#x751F;&#x6210;</h3>
<p><strong>&#x901A;&#x9053;&#x914D;&#x7F6E;&#xFF1A;</strong></p>
<pre><code>  TwoOrgsChannel:
  # &#x901A;&#x9053;&#x8054;&#x76DF;&#x540D;&#x79F0;&#xFF0C;&#x73B0;&#x5728;&#x9ED8;&#x8BA4;&#x662F;SampleConsortium
        Consortium: SampleConsortium  
     # &#x5F15;&#x7528;ChannelDefaults&#x901A;&#x9053;&#x8BE6;&#x7EC6;&#x914D;&#x7F6E;
        &lt;&lt;: *ChannelDefaults   
        Application:
        # // &#x5F15;&#x7528;ApplicationDefaults
            &lt;&lt;: *ApplicationDefaults 
            #  //&#x901A;&#x9053;&#x7EC4;&#x7EC7;&#x5B9A;&#x4E49;            Organizations:
                - *Org1
                - *Org2
            Capabilities:
                &lt;&lt;: *ApplicationCapabilities
</code></pre><p><strong>&#x901A;&#x9053;&#x8BE6;&#x7EC6;&#x914D;&#x7F6E;&#xFF1A;</strong></p>
<pre><code>Channel: &amp;ChannelDefaults
    #   &#x901A;&#x9053;&#x6743;&#x9650;&#x7B56;&#x7565;  &lt;ALL|ANY|MAJORITY&gt; &lt;sub_policy&gt;
    Policies:
        # Who may invoke the &apos;Deliver&apos; API
        Readers:
            Type: ImplicitMeta
            Rule: &quot;ANY Readers&quot;
        # Who may invoke the &apos;Broadcast&apos; API
        Writers:
            Type: ImplicitMeta
            Rule: &quot;ANY Writers&quot;
        # By default, who may modify elements at this config level
        Admins:
            Type: ImplicitMeta
            Rule: &quot;MAJORITY Admins&quot;
    # Capabilities describes the channel level capabilities, see the
    # dedicated Capabilities section elsewhere in this file for a full
    # description
    Capabilities:
        &lt;&lt;: *ChannelCapabilities
</code></pre><p>&#x4E0A;&#x9762;&#x4E3B;&#x8981;&#x662F;&#x5BF9;&#x901A;&#x9053;&#x6743;&#x9650;&#x7B56;&#x7565;&#x914D;&#x7F6E;&#xFF0C;&#x5176;&#x4E2D;&#x7B56;&#x7565;&#x8FD9;&#x5757;&#x4E3B;&#x8981;&#x6709;&#x4E24;&#x79CD;&#x7C7B;&#x578B;&#xFF1A;</p>
<p>1.Signature&#x7B56;&#x7565;</p>
<p> SIGNATURE&#x7B56;&#x7565;&#x6307;&#x5B9A;&#x901A;&#x8FC7;&#x7B7E;&#x540D;&#x6765;&#x5BF9;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x8BA4;&#x8BC1;&#xFF0C;&#x4F8B;&#x5982;&#x6570;&#x636E;&#x5FC5;&#x987B;&#x6EE1;&#x8DB3;&#x4E00;&#x5B9A;&#x7684;&#x7B7E;&#x540D;&#x8EAB;&#x4EFD;&#x7EC4;&#x5408; &#x8FD9;&#x79CD;&#x7B56;&#x7565;&#x6BD4;&#x8F83;&#x7075;&#x6D3B;&#xFF0C;&#x4E3B;&#x8981;&#x5B9A;&#x4E49;MSP&#x4E3B;&#x4F53;&#x7EC4;&#x5408;&#x89C4;&#x8303;&#x3002;&#x5728;&#x9A8C;&#x8BC1;&#x7B7E;&#x540D;&#x7B56;&#x7565;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#xFF0C;&#x652F;&#x6301;AND&#x3001;OR&#x3001;NOutOf&#xFF0C;&#x53EF;&#x4EE5;&#x6784;&#x5EFA;&#x5982;&#xFF1A;&#x2018;An admin of org A and 2 other admins, or 11 of 20 org admins&#x2019;&#x7B49;&#x89C4;&#x8303;&#x3002;
 <img src="https://img-blog.csdnimg.cn/20200212185039505.png" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;">
 2.ImplicitMeta&#x7B56;&#x7565; </p>
<p>&#x8FD9;&#x79CD;&#x7B56;&#x7565;&#x4E0D;&#x5982;SignaturePolicy&#x7075;&#x6D3B;&#xFF0C;&#x5E76;&#x4E14;&#x53EA;&#x5728;&#x914D;&#x7F6E;&#x4E0A;&#x4E0B;&#x6587;&#x4E2D;&#x6709;&#x6548;&#x3002;&#x5B83;&#x4E0D;&#x76F4;&#x63A5;&#x8FDB;&#x884C;&#x7B7E;&#x540D;&#x68C0;&#x67E5;&#xFF0C;&#x800C;&#x662F;&#x901A;&#x8FC7;&#x5F15;&#x7528;&#x5176;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x7B56;&#x7565;&#xFF08;&#x6700;&#x7EC8;&#x8FD8;&#x662F;&#x901A;&#x8FC7;Signature&#x7B56;&#x7565;&#xFF09;&#x6765;&#x8FDB;&#x884C;&#x68C0;&#x67E5; &#x68C0;&#x67E5;&#x7ED3;&#x679C;&#x53C8;Rule&#x9650;&#x5236;&#xFF0C;&#x5B83;&#x652F;&#x6301;&#x9ED8;&#x8BA4;&#x89C4;&#x5219;&#xFF0C;&#x5982;&#xFF1A;&#x2018;A majority of the organization admin policies&#x2019;&#x3002;</p>
<p><img src="https://img-blog.csdnimg.cn/20200212185116229.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI4NTQwNDQz,size_16,color_FFFFFF,t_70" alt="&#x5728;&#x8FD9;&#x91CC;&#x63D2;&#x5165;&#x56FE;&#x7247;&#x63CF;&#x8FF0;"></p>
<p><strong>&#x5171;&#x8BC6;&#x914D;&#x7F6E;</strong></p>
<pre><code>
  SampleMultiNodeEtcdRaft:
        &lt;&lt;: *ChannelDefaults
        Capabilities:
    # &#x901A;&#x9053;Capabilities &#x6307;&#x5B9A;2.0
            &lt;&lt;: *ChannelCapabilities
        Orderer:
            &lt;&lt;: *OrdererDefaults
          # &#x6392;&#x5E8F;&#x8282;&#x70B9;&#x7C7B;&#x578B;etcdraft
            OrdererType: etcdraft 
                  # &#x7CFB;&#x7EDF;&#x901A;&#x9053;&#x4E2D;raft&#x8282;&#x70B9;&#x914D;&#x7F6E; raft&#x670D;&#x52A1;&#x662F;&#x5728;order&#x8282;&#x70B9;&#x5185;
            EtcdRaft:
                Consenters:
                - Host: orderer.example.com
                  Port: 7050
                  ClientTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt
                  ServerTLSCert: crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt

            Addresses:
                - orderer.example.com:7050

            Organizations:
            - *OrdererOrg


            Capabilities:
        # &#x6392;&#x5E8F;&#x8282;&#x70B9;Capabilities &#x6307;&#x5B9A;2.0

                &lt;&lt;: *OrdererCapabilities
        Application:
            &lt;&lt;: *ApplicationDefaults
            Organizations:
            - &lt;&lt;: *OrdererOrg
        Consortiums:
            SampleConsortium:
                Organizations:
                - *Org1
                - *Org2
</code></pre><h2 id="4&#x603B;&#x7ED3;">4.&#x603B;&#x7ED3;</h2>
<p>&#x7EFC;&#x5408;&#x6765;&#x770B;&#xFF0C;&#x6BD4;&#x8D77;1.x&#x7248;&#x672C;&#x7684;Fabric,&#x5728;&#x914D;&#x7F6E;&#x6700;&#x5927;&#x7684;&#x53D8;&#x5316;&#x662F;&#x5220;&#x9664;&#x4E86;solo&#x4EE5;&#x53CA;kafka&#x6A21;&#x5F0F;&#xFF0C;&#x4EC5;&#x652F;&#x6301;etcdraft&#x5171;&#x8BC6;&#x6A21;&#x5F0F;&#x5176;&#x4F59;&#x5E76;&#x6CA1;&#x6709;&#x592A;&#x5927;&#x53D8;&#x5316;&#xFF0C;&#x56E0;&#x6B64;&#x5BF9;&#x4E8E;&#x6709;1.x&#x90E8;&#x7F72;&#x7ECF;&#x9A8C;&#x5E76;&#x4E0D;&#x4F1A;&#x9020;&#x6210;&#x592A;&#x5927;&#x7684;&#x56F0;&#x96BE;,&#x521D;&#x5B66;&#x8005;&#x53EF;&#x4EE5;&#x6162;&#x6162;&#x6839;&#x636E;&#x6559;&#x7A0B;&#x5165;&#x95E8;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="chap1.html" class="navigation navigation-prev " aria-label="Previous page: 编译与测试网络部署">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="chap3.html" class="navigation navigation-next " aria-label="Next page: 启动网络脚本配置剖析">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"网络生成配置说明","level":"1.2.2","depth":2,"next":{"title":"启动网络脚本配置剖析","level":"1.2.3","depth":2,"path":"content/chap3.md","ref":"content/chap3.md","articles":[]},"previous":{"title":"编译与测试网络部署","level":"1.2.1","depth":2,"path":"content/chap1.md","ref":"content/chap1.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"content/chap2.md","mtime":"2020-03-12T03:50:09.200Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-03-12T04:24:49.792Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

